package com.alks.function.controller.chengKong;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.function.data.request.chengKong.SellStyleSaveRequest;
import com.alks.function.data.request.chengKong.StyleNoRequest;
import com.alks.function.service.chengKong.LargeCargoTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.Map;

@ApiRestController("/sell")
@Api(tags = {"成控部-物料管理作业-大货型体建档"})
@Slf4j
public class LargeCargoTypeController {

    @Resource
    private LargeCargoTypeService largeCargoTypeService;

    @WebLogger
    @PostMapping("/getSellStyle")
    @ApiOperation(value = "取研发型体",tags = "成控部-物料管理作业-大货型体建档")
    public ResponseInfo getSellStyle(@RequestBody Map<String,String> map){
        return largeCargoTypeService.getSellStyle(map);
    }

    @WebLogger
    @PostMapping("/getSellStyleList")
    @ApiOperation(value = "型体基本资料查询",tags = "成控部-物料管理作业-大货型体建档")
    public ResponseInfo getSellStyleList(@RequestBody StyleNoRequest request){
        return largeCargoTypeService.getSellStyleList(request);
    }

    @WebLogger
    @PostMapping("/getSellStyleColorList")
    @ApiOperation(value = "型体配色资料查询",tags = "成控部-物料管理作业-大货型体建档")
    public ResponseInfo getSellStyleColorList(@RequestBody Map<String,String> map){
        return largeCargoTypeService.getSellStyleColorList(map);
    }

    @WebLogger
    @PostMapping("/getSellStyleSizeList")
    @ApiOperation(value = "型体配码资料查询",tags = "成控部-物料管理作业-大货型体建档")
    public ResponseInfo getSellStyleSizeList(@RequestBody Map<String,String> map){
        return largeCargoTypeService.getSellStyleSizeList(map);
    }

    @WebLogger
    @PostMapping("/getSellStyleTypeToList")
    @ApiOperation(value = "型体制具查询",tags = "成控部-物料管理作业-大货型体建档")
    public ResponseInfo getSellStyleTypeToList(@RequestBody Map<String,String> map){
        return largeCargoTypeService.getSellStyleTypeToList(map);
    }

    @WebLogger
    @PostMapping("/getCheckOut/{choose}")
    @ApiOperation(value = "0检核/1取消检核",tags = "成控部-物料管理作业-大货型体建档")
    public ResponseInfo get2CheckOut(@RequestBody Map<String,String> map, @PathVariable("choose") Integer choose){
        return largeCargoTypeService.getCheckOut(map,choose);
    }

    @WebLogger
    @PostMapping("/getSellStyleCopy")
    @ApiOperation(value = "复制",tags = "成控部-物料管理作业-大货型体建档")
    public ResponseInfo getSellStyleCopy(@RequestBody Map<String,String> map){
        return largeCargoTypeService.getSellStyleCopy(map);
    }

    @WebLogger
    @PostMapping("/getSellStyleSave")
    @ApiOperation(value = "保存",tags = "成控部-物料管理作业-大货型体建档")
    public ResponseInfo getSellStyleSave(@RequestBody SellStyleSaveRequest request){
        return largeCargoTypeService.getSellStyleSave(request);
    }

    @WebLogger
    @PostMapping("/updateSellStylePhoto")
    @ApiOperation(value = "上传图片",tags = {"成控部-物料管理作业-大货型体建档"})
    public ResponseInfo updateSellStylePhoto(@RequestParam(value = "file") MultipartFile file) {
        return largeCargoTypeService.updateSellStylePhoto(file);
    }

    @WebLogger
    @PostMapping("/getSellStyleDel")
    @ApiOperation(value = "整单删除",tags = {"成控部-物料管理作业-大货型体建档"})
    public ResponseInfo getSellStyleDel(@RequestBody Map<String,String> map) {
        return largeCargoTypeService.getSellStyleDel(map);
    }
}
